import request from '@/utils/request'

export function getAllTimeLine(orderBy) {
  let MyURL = '/timeLine/getAll/'
  if (orderBy === undefined) { MyURL += ('desc') }
  return request({
    url: MyURL,
    method: 'get'
  })
}
export function uploadTimeline(timeLine) {
  /*    private String id;
    private String title;
    private String category;
    private String coverImg;
    private String date;
    private String description;
    private String color;
    */
  return request({
    url: '/timeLine/upload',
    data: {
      title: timeLine.title,
      category: timeLine.category,
      coverImg: timeLine.coverImg,
      description: timeLine.description,
      color: timeLine.color
    },
    method: 'post'
  })
}
